@model EditUserViewModel

@{
    ViewBag.Title = "管理-编辑用户";
}

<h1>编辑用户</h1>

<form method="post" asp-action="EditUser">

    <div class="form-group row">
        <label asp-for="Id" class="col-sm-2 col-form-label "></label>
        <div class="col-sm-10">
            <input asp-for="Id" class=" form-control" disabled />
        </div>
    </div>

    <div class="form-group row">
        <label asp-for="Email" class="col-sm-2 col-form-label "></label>
        <div class="col-sm-10">
            <input asp-for="Email" class=" form-control" placeholder="请输入邮箱名称" />
            <span asp-validation-for="Email" class="text-danger"></span>
        </div>
    </div>
    <div class="form-group row">
        <label asp-for="UserName" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <input asp-for="UserName" class="form-control">
            <span asp-validation-for="UserName" class="text-danger"></span>
        </div>
    </div>
    <div class="form-group row">
        <label asp-for="City" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <input asp-for="City" class="form-control">
        </div>
    </div>
    <div asp-validation-summary="All" class="text-danger"></div>

    <div class="form-group row">

        <div class="col-sm-10">

            <button type="submit" class="btn btn-primary">更新</button>

            <a class="btn btn-primary" asp-action="ListUsers">取消</a>
        </div>
    </div>

    <div class=" card">
        <div class="card-header">
            <h3>用户角色</h3>
        </div>

        <div class="card-body">
            @if (Model.Roles.Any())
            {
                foreach (var role in Model.Roles)
                {
                    <h5 class="card-title">@role</h5>

                }
            }
            else
            {
                <h5 class="card-title">目前没有信息</h5>
            }
        </div>
        <div class="card-footer">

            <a asp-controller="Admin"
               asp-action="ManageUserRoles"
               asp-route-userId="@Model.Id"
               style="width:auto"
               class="btn btn-primary">
                管理角色
            </a>
        </div>
    </div>

    <div class="card mt-3">
        <div class="card-header">
            <h3>用户声明</h3>
        </div>

        <div class="card-body">
            @if (Model.Claims.Any())
            {
                foreach (var claim in Model.Claims)
                {
                    <h5 class="card-title">@claim.Type : @claim.Value</h5>

                }
            }
            else
            {
                <h5 class="card-title">目前没有信息</h5>
            }
        </div>
        <div class="card-footer">

            <a asp-action="ManageUserClaims" asp-controller="Admin" asp-route-userId="@Model.Id" style="width:auto" class="btn btn-primary">
                管理声明
            </a>
        </div>
    </div>
</form>